package edu.ucsur.tp.colegio.database;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBConnection {

  public static Connection getConnection() {
    try {
      //1.Registrar el Driver
      Class.forName("com.mysql.jdbc.Driver");
      //2. Iniciar una conexi�n
      String urlJdbc = "jdbc:mysql://localhost:3306/libreriaelsaber";
      String username = "root";
      String password = "mysql";
      Connection conn = DriverManager.getConnection(urlJdbc, username, password);
      //3. Retornar la conexi�n creada
      return conn;
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }
  
  
}
